import request from '@/utils/request'

// 获取企业列表数据
export const getEnterpriseListAPI = params => {
  return request.get('/park/enterprise', { params })
}

// 获取行业列表
export const getIndustryListAPI = () => {
  return request.get('/park/industry')
}

// 添加企业
export const addEnterpriseAPI = data => {
  return request.post('/park/enterprise', data)
}

// 获取企业详情
export const getEnterpriseDetailAPI = id => {
  return request.get(`/park/enterprise/${id}`)
}

// 编辑企业
export const editEnterpriseAPI = data => {
  return request.put('/park/enterprise', data)
}

// 查看所有企业
export const getAllEnterpriseAPI = () => {
  return request.get('/park/all/enterprise')
}

// 删除企业
export const delEnterpriseAPI = id => {
  return request.delete(`/park/enterprise/${id}`)
}

// 创建合同
export const createRentAPI = data => {
  return request.post('/park/enterprise/rent', data)
}

// 企业租赁信息列表-展开查看
export const getEnterpriseRentListAPI = id => {
  return request.get(`/park/enterprise/rent/${id}`)
}

// 退租租赁合同
export const rentingOutAPI = id => {
  return request.put(`/park/enterprise/rent/${id}`)
}

// 删除企业的租赁合同
export const rentingDelAPI = id => {
  return request.delete(`/park/enterprise/rent/${id}`)
}
